package com.zhouyu.service;

import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.stereotype.Component;

/**
 * @author zjx
 */
@Component
//这是一个多例 如果想要在@Autowire的时候依赖保持多例 就要打开proxyMode = ScopedProxyMode.TARGET_CLAS
@Scope(value = DefaultListableBeanFactory.SCOPE_PROTOTYPE,proxyMode = ScopedProxyMode.TARGET_CLASS)
public class ProtypeService {
	public void pro(){
		System.out.println(hashCode()+"------");
	}
}
